package com.bottomlord.mybatis.annotation;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.cache.Cache;
import org.apache.ibatis.io.VFS;
import org.apache.ibatis.mapping.DatabaseIdProvider;
import org.apache.ibatis.plugin.Interceptor;
import org.apache.ibatis.reflection.factory.ObjectFactory;
import org.apache.ibatis.reflection.wrapper.ObjectWrapperFactory;
import org.apache.ibatis.scripting.LanguageDriver;
import org.apache.ibatis.session.Configuration;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.apache.ibatis.transaction.TransactionFactory;
import org.apache.ibatis.type.TypeHandler;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Import;

import java.lang.annotation.*;
import java.util.Properties;

/**
 * @author ChenYue
 * @date 2021/5/7 16:22
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Documented
@Inherited
@Import(MybatisBeanDefinitionRegistrar.class)
public @interface EnableMybatis {
    /**
     * @return the bean name of {@link SqlSessionFactoryBean}
     */
    String value() default "sqlSessionFactoryBean";

    /**
     * @return DataSource bean name
     */
    String dataSource() default "defaultDatasource";

    /**
     * @return the location of {@link Configuration}
     */
    String configLocation() default "";

    /**
     * @return the location of {@link Mapper}
     * @see MapperScan
     */
    String[] mapperLocations() default {};

    /**
     * @return the value of environment
     */
    String environment() default "SqlSessionFactoryBean";

    /**
     * @return the value of typeAliasesPackage
     */
    String typeAliasesPackage() default "";

    /**
     * @return the value of typeHandlerPackage
     */
    String typeHandlersPackage() default "";

    /**
     * @return the value of failFast
     */
    boolean failFast() default false;
}
